package com.hlb.zh.controller;

import com.github.pagehelper.Page;
import com.hlb.zh.pojo.Students;
import com.hlb.zh.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/12/16.
 */
@Controller
public class StudentController {
    @Autowired
    StudentService studentService;
    @RequestMapping("list")
    public String list(Integer pageNo,Integer pageSize,Map<String,Object> map) throws Exception {
        int pageNum=1;
        int row=10;
        try{
           pageNum=pageNo;
        }catch (Exception e){};
        try{
            row=pageSize;
        }catch (Exception e){};
         com.hlb.zh.page.Page<Students> studentsPage=studentService.getPage(pageNum,row);
        map.put("obj",studentsPage);
        return "students";
    }

}
